﻿namespace SharpF2.ModelView
{
	using System;

	/// <summary>
	/// Define a text resource; text, Identifiers...
	/// </summary>
	public class TextItem : Item
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="TextItem" /> class. 
		/// Default constructor.
		/// </summary>
		public TextItem()
		{
			Text = String.Empty;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="TextItem" /> class. 
		/// Constructor specifying an input text resource.
		/// </summary>
		/// <param name="text">The input file path.</param>
		public TextItem(string text)
		{
			Text = text;
		}

		#endregion

		#region Private Attributes

		/// <summary>
		/// The text resource.
		/// </summary>
		private string text;

		#endregion

		#region Public Properties

		/// <summary>
		/// Gets or sets Text.
		/// </summary>
		public string Text
		{
			get { return text; }

			set
			{
				text = value;
				RegexText = value;
				NotifyPropertyChanged("Text");
			}
		}

		#endregion
	}
}